<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="public::head('投票表决')">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="UTF-8"></meta>

</head>
<body style="padding-top:50px;">
<input type="hidden" th:value="${session.Id}" id="id"/>
<input type="hidden" th:value="${session.Type}" id="Type"/>

<div th:replace="public/top_vote::top"></div>

<div id="Votelist">

    <div class="primary-title">
        <div style="margin-top:15px;text-align: center;font-size:24px">
            <label  style="margin-left: 20px; ">{{xiangmu.xiangmuname}}</label>
        </div>
        <div style="text-align: center;font-size:18px">
            <label  style="margin-left: 20px; ">总数： {{total}} 同意： <font color="green">{{tongyishu}}</font> 不同意： <font color="red">{{butongyishu}}</font></label>
            <input v-if="!issubmited" type="button" class="btn btn-sm btn-primary" style="width: 60px" value="提交" @click="tosubmit()">
            <input v-if="issubmited" type="button" class="btn btn-sm btn-success" disabled style="width: 60px" value="已提交" @click="tosubmit()">
        </div>
        <div style="font-size:18px; align-items: center; justify-content: center">

<!--            <input type="button" class="btn btn-sm btn-danger" style="margin-right: 10px;float: right" value="全不同意" @click="toVoteAll(0)">-->
<!--           <input type="button" class="btn btn-sm btn-success" style="margin-right: 10px;float: right" value="提交" @click="toVoteAll(1)">-->
        </div>
    </div>

    <div style="height: 30px"></div>

    <div class="primary-content">

<!--        <table class="table table-hover table-striped">-->
<!--            <thead>-->
<!--            <th style="text-align:center;vertical-align:middle;width: 50px;">序号</th>-->
<!--            <th style="text-align:center;vertical-align:middle;">品种</th>-->
<!--            <th style="text-align:center;vertical-align:middle;">品牌</th>-->
<!--            <th style="text-align:center;vertical-align:middle;">型号拆分</th>-->
<!--            <th style="text-align:center;vertical-align:middle;">平台编码</th>-->
<!--            <th style="text-align:center;vertical-align:middle;">注册证名称</th>-->
<!--            <th style="text-align:center;vertical-align:middle;">规格</th>-->
<!--            <th style="text-align:center;vertical-align:middle;">型号</th>-->
<!--            <th style="text-align:center;vertical-align:middle;">注册证号</th>-->
<!--            <th style="text-align:center;vertical-align:middle;">生产商</th>-->
<!--            <th style="text-align:center;vertical-align:middle;">计价单位</th>-->
<!--            <th style="text-align:center;vertical-align:middle;">平台情况（江苏省/南京市/申请备案）</th>-->
<!--            <th style="text-align:center;vertical-align:middle;">平台单价（元）</th>-->
<!--            <th style="text-align:center;vertical-align:middle;">南京市医保码（CLXXXXXXXX)</th>-->
<!--            <th style="text-align:center;vertical-align:middle;">简要功能用途（20字左右）</th>-->
<!--            <th style="text-align:center;vertical-align:middle;width:160px;">表决建议</th>-->
<!--            </thead>-->
<!--            <tbody>-->
<!--            <tr v-for="(voteitem,index) in votelist" v-if="show">-->
<!--                <td style="text-align:center;vertical-align:middle;" v-text="index+1"></td>-->
<!--                <td style="text-align:center;vertical-align:middle;" v-text="voteitem.shiyongkeshi"></td>-->
<!--                <td style="text-align:center;vertical-align:middle;" v-text="voteitem.shebeimingcheng"></td>-->
<!--                <td style="text-align:center;vertical-align:middle;" v-text="voteitem.danjia"></td>-->
<!--                <td style="text-align:center;vertical-align:middle;" v-text="voteitem.shuliang"></td>-->
<!--                <td style="text-align:center;vertical-align:middle;" v-text="voteitem.yusuanjine"></td>-->
<!--                <td style="text-align:center;vertical-align:middle;" v-text="voteitem.shebeileixing"></td>-->
<!--                <td style="text-align:center;vertical-align:middle;" v-text="voteitem.tongyongmingcheng"></td>-->
<!--                <td style="text-align:center;vertical-align:middle;" >-->
<!--                <div style="text-align:center;">-->
<!--                    <input type="button" class="btn btn-sm btn-info" value="查看" @click="toshowDetail(voteitem.beizhu)">-->
<!--                </div>-->
<!--                </td>-->
<!--                <td style="text-align:center;vertical-align:middle;" >-->
<!--                    <div style="text-align: center" :id="'jieguo'+voteitem.id">-->
<!--                        <span v-if="voteitem.result==null" style="color:blue">未表决</span>-->
<!--                        <span v-if="voteitem.result==0" style="color:red">不同意</span>-->
<!--                        <span v-if="voteitem.result==1" style="color:green">同意</span>-->
<!--                    </div>-->
<!--                    <div style="text-align:center;">-->
<!--                        <input type="button" class="btn btn-sm btn-success" style="margin-left: 10px;float: left" value="同意" @click="toVote(voteitem.id,1)">-->
<!--                        <input type="button" class="btn btn-sm btn-danger" style="margin-left: 10px;float: left" value="不同意" @click="toVote(voteitem.id,0)">-->

<!--                    </div>-->




<!--                </td>-->
<!--            </tr>-->

<!--            </tbody>-->
<!--        </table>-->

        <div id="List">
        </div>



        <div v-if="!show" style="text-align:center;width:100%;">查无数据</div>

        <div v-if="show" class="my-page-navigation">
            <button class="btn btn-default" v-on:click="SetPageIndex">首页</button>
            <button class="btn btn-default" v-on:click="SetPageIndexPrePage">上一页</button>
            <span v-text="pageIndex + '  /  ' + pageCount"></span>
            <span v-text="'共' + recordCount + '条品种'"></span>
            <button class="btn btn-default" v-on:click="SetPageIndexNextPage">下一页</button>
            <button class="btn btn-default" v-on:click="SetPageEnd">尾页</button>
            <span>跳到第</span>
            <input type="text" class="form-control" style="width: 80px;display:inline-block;"  v-model="inputPageIndexValue" v-on:keyup.enter="JumpPage">
            <span>页</span>
            <button class="btn btn-default" v-on:click="JumpPage">跳</button>
        </div>

    </div>



</div>

</body>
<script th:src="@{/js/vote/list_haocaiyinjin_vote.js?v=1.04}"></script>

<script type="text/javascript">
    var ID = $("#id").val();
    $(function() {
        if(ID==""){
            alert("请先登录！");
            location.href='../main/login';
        }
    });

    function toVote(ppId,ppPinzhong,ppPinpai,ppResult){

        layer.open({type: 3});
        $.post('/haocaijieguo/toupiao', {
            id: ppId,
            pinzhong:ppPinzhong,
            pinpai:ppPinpai,
            userid:$("#id").val(),
            result: ppResult,
            rdm: Math.random()
        }, function (ppData) {
            layer.closeAll("loading");
            if (ppData != null) {
                if (ppData.result == "1") {

                    if(ppResult=="1"){
                        $("#div_"+ppPinzhong+"_"+ppPinpai+"").html("<span style=\"color:#008000\">同意</span>");
                    }
                    if(ppResult=="0"){
                        $("#div_"+ppPinzhong+"_"+ppPinpai+"").html("<span style=\"color:#ff0000\">不同意</span>");
                    }
                    vote.getYinjinResultCount();
                } else {
                    layer.alert(ppData.message);
                }
            }
        }, "json");

    }


</script>
<style>
    a {
        text-decoration: none;
        color:#333;
    }
    /*正常的未被访问过的链接*/
    a:link {
        text-decoration: none;
    }
    /*已经访问过的链接*/
    a:visited {
        text-decoration: none;
    }
    /*鼠标划过(停留)的链接*/
    a:hover {
        text-decoration: none;
    }
    /* 正在点击的链接*/
    a:active {
        text-decoration: none;
    }
</style>
</html>